package com.IR.product.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.IR.product.service.AProductCommentBIZ;
import com.IR.shop.po.Productcomment;

@Controller
public class AProductCommentAction {

	@Resource
	private AProductCommentBIZ biz;
	
	/*删除评论*/
	@RequestMapping(value="deleteProComment.do")
	public void deleteProComment(HttpServletRequest request,HttpServletResponse response) throws IOException {
		response.setHeader("Access-Control-Allow-Origin", "*");
		response.setCharacterEncoding("utf-8");
		int pcid=new Integer(request.getParameter("pcid"));
		biz.deleteProComment(pcid);
		PrintWriter out = response.getWriter();
		out.println(1);
	}
	
	/*添加评论*/
	@RequestMapping(value="saveProComment.do")
	public void saveProComment(Productcomment procomment) {
		biz.saveProComment(procomment);
	}
	
}
